package advanced.sorm;

public class MysqlConvertor implements TypeConvertor {
    @Override
    public String databaseType2JavaType(String columnType) {
        String tartgetType = null;
        switch (columnType) {

            case "varchar":
                tartgetType = "String";
                break;
            case "char":
                tartgetType = "String";
                break;
            case "int":
                tartgetType = "Integer";
                break;
            case "tinyint":
                tartgetType = "Integer";
                break;
            case "smallint":
                tartgetType = "Integer";
                break;
            case "bigint":
                tartgetType = "Long";
                break;
            case "float":
                tartgetType = "Double";
                break;
            case "double":
                tartgetType = "Double";
                break;
            case "date":
                tartgetType = "java.sql.Date";
                break;
            case "clob":
                tartgetType = "java.sql.BLob";
                break;
            case "blob":
                tartgetType = "java.sql.CLob";
                break;
            case "Time":
                tartgetType = "java.sql.Time";
                break;
            case "timestamp":
                tartgetType = "java.sql.TimeStamp";
                break;
            default:
                break;

        }
        return tartgetType;
    }

    @Override
    public String javaType2DatabaseType(String javaDataType) {
        return null;
    }
}
